package com.learn.jackson.annotation.jsonUnwrapped;

import com.fasterxml.jackson.annotation.JsonUnwrapped;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldDefaults;

/**
 * @author XuYang
 * @since 2025/6/9 9:41
 */
@Data
@NoArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@AllArgsConstructor(staticName = "of")
public class JsonUnwrappedEntity {
    Long id;
    @JsonUnwrapped(prefix = "prefix_", suffix = "_suffix")
    Inner inner;

    @Data
    @NoArgsConstructor
    @FieldDefaults(level = AccessLevel.PRIVATE)
    @AllArgsConstructor(staticName = "of")
    public static class Inner {
        Long id;
        String name;
    }
}
